package com.bosssoft.g4.api;

import com.bosssoft.common.result.Result;
import com.bosssoft.g4.bo.SubSystemTree;
import com.bosssoft.g4.dto.ResourceDTO;
import com.bosssoft.g4.vo.ResourceVO;
import org.springframework.web.bind.annotation.*;

import javax.validation.constraints.NotNull;
import java.util.List;

/**
 * @author Baiye959
 */
@RequestMapping("/api/v1/permission")
public interface ResourceApi {
    @GetMapping("/resources")
    public Result<List<ResourceVO>> getResourceList(ResourceDTO resourceDTO);
    @GetMapping("/resource")
    public Result<ResourceVO> getResourceById(@RequestParam("id") @NotNull Long id);
    @PostMapping("/resource")
    public Result<Long> insertResource(@RequestBody @NotNull ResourceVO resourceVO);

    @PutMapping("/resource")
    public Result<Boolean> updateResource(@RequestBody ResourceVO resourceVO);

    @DeleteMapping("/resource")
    public Result<Boolean> deleteResourceById(@RequestParam("id") @NotNull Long id);

    @DeleteMapping("/batch/resource")
    public Result<Boolean> deleteResourceByIdList(@RequestBody List<Long> idList);

    @GetMapping("/tree/resource")
    public Result<List<SubSystemTree>> getTreeResourceList();
}
